<html>
<head><meta charset="utf-8"><title>Better auto-importing comletion caching · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html">Better auto-importing comletion caching</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220779825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Better%20auto-importing%20comletion%20caching/near/220779825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html#220779825">(Dec 23 2020 at 11:14)</a>:</h4>
<p>Just a though, but, in theory, it seems like we can cache auto-imports for completion much more agressively</p>



<a name="220779845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Better%20auto-importing%20comletion%20caching/near/220779845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html#220779845">(Dec 23 2020 at 11:15)</a>:</h4>
<p>When the user types new symbols at a given position, the sate of the world isn't really changing, so we should be able to re-use most of the auto-importing work</p>



<a name="220779861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Better%20auto-importing%20comletion%20caching/near/220779861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html#220779861">(Dec 23 2020 at 11:15)</a>:</h4>
<p>(in contrast to type-directed completions, where we have to-rerun type inference on modified code)</p>



<a name="220779914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Better%20auto-importing%20comletion%20caching/near/220779914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html#220779914">(Dec 23 2020 at 11:16)</a>:</h4>
<p>Basically, auto-import should only depend on item tree and a particular module</p>



<a name="220779919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Better%20auto-importing%20comletion%20caching/near/220779919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Better.20auto-importing.20comletion.20caching.html#220779919">(Dec 23 2020 at 11:16)</a>:</h4>
<p>(though inspired by <a href="https://github.com/rust-analyzer/rust-analyzer/blob/0dec77abe744e5c4910b9ff0ce0c443cee425040/crates/rust-analyzer/src/bin/main.rs#L107-L108">https://github.com/rust-analyzer/rust-analyzer/blob/0dec77abe744e5c4910b9ff0ce0c443cee425040/crates/rust-analyzer/src/bin/main.rs#L107-L108</a>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>